from selenium import webdriver
browser = webdriver.Chrome()  # 调用本地的Chrome浏览器
numberFile = open('number.txt','r')
number = numberFile.read()
numberFile.close()
hostFile = open('hots.txt','r')
hostName = hostFile.read()
browser.get('https://'+hostName+'/video/video_list.html?video_type=1&page_index='+number)  # 请求页面，会打开一个浏览器窗口
html_text = browser.page_source  # 获得页面代码
browser.quit()  # 关闭浏览器
file3 = open('/Users/mac032/itianyu/blog/storage/video/'+number+'.html', 'w',encoding='UTF-8')
file3.write(html_text)
file3.close()
numberFile2 = open('number.txt','w')
numberFile2.write(str(int(number)+1))
numberFile2.close()


# number='1'
# file3 = open('/Users/mac032/itianyu/blog/storage/video/'+number+'.html', 'w',encoding='UTF-8')
# file3.write('111')
# file3.close()
